#A prototype, also described as a template, tells the compiler
#how many and what types of arguments the subroutine should get
# when it is called.
#  Prototype: (Perl 5.003+)
#    sub subroutine_name($$);
#    Takes two scalar arguments
#
#    sub subroutine_name(\@);
#    Argument must be an array, preceded with an @ symbol
#
#    sub subroutine_name($$;@)
#    Takes two scalar arguments and an optional array.
#    Anything after the semi-colon is optional.
  

sub greet ($$) #arguments must be two scalar variables
{
	my ($fname, $lname) = @_; 
	$fname = "wang";
	print "$fname - $lname\n" ;
}

#1st is arrary, 2nd is scalar, 3rd is optional scalar
sub mynumbs (@$;$)
{
	my $scalar = pop(@_);
	my @arr = @_;
	print "arrary is: @arr. \n scalar is $scalar.\n";
}

my $first = "Zhao" ;
my $last  = "Yang" ;

greet ( $first, $last) ;
my @list = (1,2,3,4);
mynumbs(@list, 4);

print "$first - $last\n";
